package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.enhe.gck.CarbonRelationType;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.record.annotation.Relation;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

// 组合充值
@Data
@CarbonRecord("hwane28300")
public class BundleRecharge implements Updatable{
    @JSONField(name="唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    // 充值类型
    @JSONField(name = "充值类型")
    @Attribute("hwan28303")
    private String type;

    // 单价
    @JSONField(name="单价")
    @Attribute("hwan28310")
    private BigDecimal unit;

    // 税率
    @JSONField(name="税率")
    @Attribute("hwan28311")
    private BigDecimal taxRate;

    @Relation(CarbonRelationType.RR_组合充值_客户组合充值_客户管理)
    private Customer customer;

    @Relation(CarbonRelationType.RR_组合充值_充值的产品_产品管理)
    private Goods goods;

    @Relation(CarbonRelationType.RR_组合充值_组合充值记录_组合充值明细)
    private List<BundleRechargeDetail> bundleRechargeDetails;



    @Override
    public String getRecordCode() {
        return this.id==null ? null : this.id.toString();
    }
}